Skip to content

P4-13: spike on real legacy outputs under GnuCOBOL - #497

Merged
sknampally merged 1 commit into
developfrom
p4/gnucobol-spike
Nov 28, 2026
Merged

sknampally merged 1 commit into
developfrom
p4/gnucobol-spike

Conversation

@sknampally

Copy link
Copy Markdown
Collaborator

P4-13 (#423), part of #386. The note is docs/spikes/p4-13-gnucobol.md, and the harness is in docs/spikes/p4-13/. There is no product code; only docs change.

Answer: yes, for the batch programs that run, and the real outputs found a rule the reconciliation got wrong.

  • What runs: 10 of CardDemo's 12 batch programs compile under GnuCOBOL 3.1.2, and 8 run to a normal end on CardDemo's own data, in the nightly cycle's order.
    • CBSTM03A crashes: it walks z/OS control blocks.
    • CBEXPORT and CBIMPORT don't compile as written: their RECORD KEY is a WORKING-STORAGE field.
  • The rules against the real outputs: a Python check carries out the reconciled rules for posting and interest on the same data, independently of the COBOL.
    • 300 of 300 reject decisions agree.
    • Every account and category balance agrees after posting.
    • 50 of 50 interest amounts agree, but only truncated to the cent; just 22 of 50 match when rounded. The rule doesn't say how to round.
  • A wrong rule, and a CardDemo defect: the reconciled rule says the interest batch posts the last account's interest at end of file. The real run shows it never does: the loop ends before its end-of-file branch runs.

Setup:

  • GnuCOBOL is Debian's gnucobol3 package, in a container. Homebrew couldn't build it on this Intel Mac, and nothing was installed on the Mac.
  • The harness supplies stand-ins for what isn't COBOL (CEE3ABD, the assembler COBDATFT, DFSORT), a driver for CBACT04C's JCL PARM, and the VSAM files built from CardDemo's data with the JCL's keys.
  • About two hours, with no cloud and no cost.

Proposed in the note: a story for an optional "legacy run" in the golden datasets, where a difference between the real output and the rule becomes an SME question on that rule. And for the owner: correct the interest rules in the next reconciliation round.

Prepared with AI assistance.

The spike note, docs/spikes/p4-13-gnucobol.md, answers D12 of
docs/pipeline-4.md: CardDemo's batch programs compiled and run under
GnuCOBOL, and their outputs set against the reconciled rules. The
harness that ran it is in docs/spikes/p4-13/. It is not product code,
and the run's outputs are not committed.

- 10 of the 12 batch programs compile under GnuCOBOL 3.1.2 (Debian's
  package, in a container) and 8 run to a normal end on CardDemo's own
  data, in the JCL's order. CBSTM03A reads z/OS control blocks and
  crashes. CBEXPORT and CBIMPORT do not compile as written: their RECORD
  KEY is a WORKING-STORAGE field.
- What they needed: tabs expanded; -fsign=EBCDIC for the data's
  overpunch signs; stand-ins for CEE3ABD and COBDATFT (translated line
  for line); a driver for CBACT04C's JCL PARM; the VSAM files built
  from the ASCII data with the JCL's keys and the XREF alternate key;
  and a stand-in for DFSORT.
- The reconciled rules for posting and interest agree with the real
  outputs: 300 of 300 reject decisions, every account and category
  balance after posting, and 50 of 50 interest amounts, but only when
  amounts are truncated to the cent, which the interest rule does not
  say.
- One recommended rule is wrong. The interest batch never posts the
  last account's interest: its loop ends before the end-of-file branch
  runs. That is a defect in CardDemo, and the rule says the opposite.

The plan's P4-13 row and D12 in docs/pipeline-4.md record the result,
and the note proposes a story for an optional legacy run in the golden
datasets.

Prepared with AI assistance.
@sknampally
sknampally merged commit e265b60 into develop Nov 28, 2026
10 checks passed
@sknampally
sknampally deleted the p4/gnucobol-spike branch November 28, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant